package com.hxs.learn.common.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author kevin
 */
@Data
public class TreeJson<T> implements Serializable, Comparable<TreeJson> {

    /**
     * 树节点id
     **/
    private String id;

    /**
     * 树节点名称
     */
    private String name;

    /**
     * 父节点ID
     */
    private String pid;

    /**
     * 树子节点
     */
    private List<TreeJson<T>> children;

    private boolean _children;

    private Integer seq;

    /**
     * 附加数据
     **/
    private T data;

    private boolean checked = false;

    @Override
    public int compareTo(TreeJson o) {
        return (o.seq - this.seq);
    }
}
